package com.mashibing.test.case10;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.convert.support.DefaultConversionService;

public class Main {
	@Test
	public void testStringToStudentConvert() {
		String[] configs = {"/com/mashibing/test/case10/applicationContext.xml"};
		ApplicationContext ctx = new ClassPathXmlApplicationContext(configs);
		DefaultConversionService conversionService = (DefaultConversionService)ctx.getBean("conversionService");
		Student convert = conversionService.convert("1_张三", Student.class);
		System.out.println(convert);
	}
}
